home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / c / pro14 / prntln.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-04-02  |  640 b   |  26 lines

  1. #include <stdio.h>
  2. /* #include <strings.h> */
  3. #include "Extern.h"
  4. PrintLine(OffSet,LineStart,LineEnd)
  5. int OffSet; /* offset of LineStart from beginning of file */
  6. char *LineStart,
  7.     *LineEnd;
  8. {
  9.     char OffStr[80];
  10.     if (lFlag) {
  11.         sprintf(OffStr,"%s\n",FileName);
  12.         write(1,OffStr,strlen(OffStr));
  13.         return;
  14.     } /* if */
  15.     if (FileName) {
  16.         sprintf(OffStr,"%s: ",FileName);
  17.         write(1,OffStr,strlen(OffStr));
  18.     } /* if */
  19.     if (nFlag) {
  20.         sprintf(OffStr,"%d: ",OffSet);
  21.         write(1,OffStr,strlen(OffStr));
  22.     } /* if */
  23.     write(1,LineStart,LineEnd-LineStart+1);
  24.     if (*LineEnd != '\n') write (1,"\n",1);
  25. } /* PrintLine */
  26.